#@layout()
#define main()
<h1>机型管理&nbsp;&nbsp;
    #if(session.user.role==1)
    <a href="/aircraft/add">创建机型</a>
    #end
</h1>
#include("_search.html")
<div class="table_box">
    <table class="list">
        <tbody>
        <tr>
            <th width="4%" style="text-align:center;">id</th>
            <th width="15%" style="text-align:center;">飞机编号</th>
            <th width="15%" style="text-align:center;">飞机类型</th>
            <th width="10%" style="text-align:center;">座位数</th>
            <th width="15%" style="text-align:center;">生产国家或地区</th>
            <th width="15%" style="text-align:center;">航线编号</th>
            #if(session.user.role==1)
            <th width="20%" style="text-align:center;">操作</th>
            #end
        </tr>

        #for(x : aircraftPage.getList())
        <tr>
            <td style="text-align:center;">#(x.id)</td>
            <td style="text-align:center;">#(x.airno)</td>
            <td style="text-align:center;">#(x.airtype)</td>
            <td style="text-align:center;">#(x.seatnum)</td>
            <td style="text-align:center;">#(x.location)</td>
            <td style="text-align:center;">#(x.airrouteno)</td>
            #if(session.user.role==1)
            <td style="text-align:center;">
                &nbsp;<a href="/aircraft/delete/#(x.id)">删除</a>
                &nbsp;<a href="/aircraft/edit/#(x.id)">修改</a>
                &nbsp;<a href="/aircraft/airroute/#(x.id)">选择航线</a>
                &nbsp;<a href="/aircraft/deleteairroute/#(x.id)">撤销航线</a>
            </td>
            #end
        </tr>
        #end
        </tbody>
    </table>
    #@paginate(aircraftPage.pageNumber, aircraftPage.totalPage, "/aircraft/")
</div>
#end